package com.exp.controller;

import com.exp.model.User;
import com.exp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * Created by WangBin on 2015/9/3.
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/view")
    public String view(){
        return "user/list";
    }
    @RequestMapping("/list")
    @ResponseBody
    public List<User> list(@RequestParam(required = false) Map<String,Object> params){
        return userService.getList(params);
    }
}
